import com.example.demo.Easettle;
import com.example.demo.Question;
import com.example.demo.Teacher;

/**
 * Created by Easettle
 * Date:2020/6/17 23:16
 * Email:easettle@qq.com
 */
public class ObserverPatternApplication {

    public static void main(String[] args) {
        Easettle easettle = Easettle.getInstance();
        Teacher tom = new Teacher("Tom");
        Teacher jeck = new Teacher("jeck");
        easettle.addObserver(tom);
        easettle.addObserver(jeck);
        Question question = new Question();
        question.setUserName("张三");
        question.setContent("观察者模式适用的场景有哪些?");
        easettle.publishQuestion(question);
    }
}
